import numpy as np

a = np.random.randint(10000000, 99999999, size=8)
print(a)
print(type(a))
a = a.tolist()
print(a)
a = np.array([1, 2, 3])
print(a)
a = np.array([1, 2, 3, 4, 5, 6, 7])
print(a[0])
a[0] = 10
print(a)
print(a[:3])
b = [1, 2, 3, 4, 5, 6, 7]
b[0] = 10
print(b)
c = b[3:]
print(c)
c[0] = 1
print(b)
print(c)
d = a[3:]
print(d)
d[0] = 1
print(d)
print(a)
a = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]])
print(a[1, 3])
print(a.ndim)
print(a.shape)
print(a.size)
print(a.dtype)
# 创建常用数组
a = np.zeros(3)
print(a)
a = np.ones(3, dtype=np.int32)
print(a)
a = np.empty(2)
print(a)
a = np.arange(5)
print(a)
a = np.arange(0, 10, 2)
print(a)
a = np.linspace(0, 100, 11, dtype=np.int32)
print(a)
arr = np.array([10, 2, 5, 7, 3, 8, 1, 9, 4, 6])
np.sort(arr)
print(arr)

print('34' in '1234' == True)
